furny.furndb.importer
Interface IModelSource

All Known Implementing Classes:
DBModelSource, FileModelSource, FilePathModelSource

public interface IModelSource

Interface to iterate over models.

Since:
26.06.2011
Author:
stephan

Method Summary
 int getSize()
          Returns the number of elements.
 boolean hasNext()
          Method to check if more elements are there.
 Furniture next()
          Gets the next element.
 Furniture next(int offset)
          This methods works like next(), but allows to skip elements.
 Furniture previous()
          Gets the previous element.
 void reset()
          Resets and starts at the first element.
 void seek(Furniture furn)
          Seeks the given furniture and remembers its position.
 

Method Detail

reset

void reset()
Resets and starts at the first element.

Since:
26.06.2011

hasNext

boolean hasNext()
Method to check if more elements are there.

Returns:
more elements are left
Since:
26.06.2011

next

Furniture next()
Gets the next element. It simply calls next(1).

Returns:
the next furniture
Since:
26.06.2011

previous

Furniture previous()
Gets the previous element. It simply calls next(-1).

Returns:
the previous furniture.
Since:
26.06.2011

next

Furniture next(int offset)
This methods works like next(), but allows to skip elements. If the offset is negative, it will return previous elements.

The method works circular, when hasNext() returns false, and the last element is reached, a call to next() will start at the first element.

Parameters:
offset - The offset of elements
Returns:
the furniture at the desired position
Since:
26.06.2011

getSize

int getSize()
Returns the number of elements.

Returns:
the number of elements.
Since:
26.06.2011

seek

void seek(Furniture furn)
Seeks the given furniture and remembers its position. A call to next() will give the element after the seeked element.

Parameters:
furn - The furniture to seek
Since:
26.06.2011